<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
  <head>
    
    <title>更换仓库管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    	
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="../css/manual.css">
	
  </head>
  
  <body>
  
  <table  width="100%"  border="0" cellpadding="0" cellspacing="0" height="100%">
  	<tr valign="top">
  	
  		<td height="100">
  			 <jsp:include page="/background/operator/head.jsp"></jsp:include>
  		</td>
  	</tr>
  	<tr valign="top">
  		<td>
  		
   
   
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
  
 <tr>
    	<td width="270" align="center">
    		
    	</td>
    	<td width="100%">

    	</td>
    </tr>
    
    <tr>
    	<td valign="top">
     		<div>
     		
     		</div>
					<s:include value="/background/operator/left.jsp"></s:include>		
     	</td>
     	
     	
     	<td valign="top" >
     	
     	<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		<tr>
     			<td>查找更换仓库信息
     			
     			<input type="button" value="查看谁有权限" 
     				onclick="javascript:openUrlForDialog('selectoperatorlimitedAction_background.action?limitedCode=<s:property value="limitedcode"/>')"/>
     			</td>
     			<td align="right"> <a href="preaddchangewarehouse_warehouse.action">更换仓库</a> </td>
     		</tr>
     	</table>
     	
     	<table align="center">
     		<tr>
     			<td><s:fielderror id="errormessage" /></td>
     		</tr>
     	</table>
     	
    <form id="managereceiptlist_warehouse" name="managereceiptlist_warehouse" onSubmit="return true;" action="managechangewarehouse_warehouse.action" method="POST" >
    	
			<table  border="0" >
				<tr> 
				  <td>
					  查找更换仓库信息:<input type="text" name="searchStr" size="30" value="<s:property value="searchStr"/>"/>
					  <input type="submit" value="查找" />
				  </td>
			  </tr>
			</table>
	</form> 
	
	
		<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		<tr>
     			<td>更换仓库列表
     			
     			</td>
     		</tr>
     	</table>
		
		
		
		<table >
			<tr>
				
					<td style="border-bottom:#e5f3ff solid 1px;" width="105">更换流水号</td>
					<td style="border-bottom:#e5f3ff solid 1px;" width="305">产品名称</td>
					<td style="border-bottom:#e5f3ff solid 1px;">产品数量</td>
					<td style="border-bottom:#e5f3ff solid 1px;" >仓库名称</td>
					<td style="border-bottom:#e5f3ff solid 1px;">目标仓库名称</td>
			
					
					<td style="border-bottom:#e5f3ff solid 1px;" width="90">更换时间</td>
					
					<td style="border-bottom:#e5f3ff solid 1px;">操作人</td>
					
				</tr>
		
			<s:iterator id="list" value="list">
				<tr>
				
						
						
					<td style="border-bottom:#e5f3ff solid 1px;">
						<a href="#"><s:property value="#list.id_changewarehouserecord"/></a>
						
					
					</td>
					
					
					<td style="border-bottom:#e5f3ff solid 1px;">
					<a href="#">
						<s:property value="#list.goodsname_changewarehouserecord"/>
					</a>
					</td>
					<td style="border-bottom:#e5f3ff solid 1px;">
					
						<s:property value="#list.number_changewarehouserecord"/>
					
						</td>
					<td style="border-bottom:#e5f3ff solid 1px;"><s:property value="#list.warehousename_changewarehouserecord"/>
					</td>
					<td style="border-bottom:#e5f3ff solid 1px;"><s:property value="#list.targetwarehousename_changewarehouserecord"/></td>
					
					<td style="border-bottom:#e5f3ff solid 1px;"><s:property value="#list.date_changewarehouserecord"/></td>
					
					<td style="border-bottom:#e5f3ff solid 1px;"><s:property value="#list.username_changewarehouserecord"/></td>
					
					
					
						
						
						
				</tr>
			</s:iterator>
		</table>
	
	<table width="100%" border="0" cellpadding="0" bgcolor="" cellspacing="0" >
				<tr >
					<td >
					<%
						String url = "managechangewarehouse_warehouse.action";//*/
						int pageSize = (Integer) request.getAttribute("pageSize");
						int beginPageNum =  (Integer) request.getAttribute("beginPageNum");
						int countRow =  (Integer) request.getAttribute("rowNum");
					    int countPage =(countRow-1)/pageSize+1;
					    int currentPage = countPage - (countRow-beginPageNum)/pageSize;
					    
					    
					    
					 	 
					    
					    String searchstr = (String)request.getParameter("searchStr");//*/
					    if(searchstr != null){
					    	searchstr = java.net.URLDecoder.decode(searchstr, "UTF-8");
					    	searchstr = java.net.URLEncoder.encode(searchstr,"UTF-8");
					    	searchstr = searchstr.replaceAll("%", "%25");
					    }else{
					    	searchstr = "";
					    }
					    
					    if((beginPageNum-pageSize+1) >= 1){%>
				    	<a href="<%=url %>?searchStr=<%=searchstr %>&beginPageNum=<%=(beginPageNum-pageSize) %>">
								上一页 </a>
				   <% }
					    
					    //beginPageNum =  (pageNum - 1) * pageSize;
						StringBuffer chagePageBuff = new StringBuffer();
						if(countPage >= 2){ 
							int begin = currentPage - 9;
							int end = currentPage + 9;
							
							if(begin < 1){
								begin = 0;
							}
							if(end > countPage){
								end = countPage-1;
							}
							
							
							for(int i=begin;i<countPage;i++){
								
								
								
								
								
								if(beginPageNum == i*pageSize){
									%>
									<%=i+1 %>
									<%
								}else{
									%>
									<a href="<%=url %>?searchStr=<%=searchstr %>&beginPageNum=<%=i*pageSize %>">
									[<%=i+1 %>] </a>
									<%
								}
								
								if(i > end){
									
									break;
									
								}
							}
						}
						
						if((beginPageNum+pageSize-countRow) < 0){%>
				    	<a href="<%=url %>?searchStr=<%=searchstr %>&beginPageNum=<%=(beginPageNum+pageSize) %>">
								下一页 </a>
				   		<% }
						if(countPage != 1){%>
			    		<input type="text" size="4" id="goPageNum" name="goPageNum"/> / <%=countPage %> <button onclick="gotoPage();">跳转</button>
				   		<% }
						//*/
						%>
					</td>

				</tr>
				
			</table>
			
	</td>
	
	
	
</tr>

</table>

</td>
</tr>
<tr valign="bottom">
	<td>
		<jsp:include page="/background/operator/tail.jsp"></jsp:include>
	</td>
</tr>
</table>



  </body>
<script type="text/javascript">

function del(name,id){
	if(confirm("取消  "+"出货单号:"+id+" 客户ID:\"" + name + "\"")){
		window.location.href='cancelreceiptlist_warehouse.action?id=' + id;
	}
}


function gotoPage(){
	countPage = <%=countPage %>;
	pageSize = <%=pageSize %>;
	pageNum = document.getElementById("goPageNum").value;

	pageNum = parseInt(pageNum);
	if(pageNum > countPage){
		pageNum = countPage;
	}
	beginPageNum = pageNum * pageSize - pageSize;
	if(beginPageNum < 0){
		beginPageNum = 0;

	}
	if(isNaN(beginPageNum)){
		beginPageNum = 0;
	}
	url = '<%=url %>?searchStr=<%=searchstr %>&beginPageNum=' + beginPageNum;
	//alert(url);
	window.location.href=url;
}
</script>
</html>
